import csv
import os

source_delimiter = ','
target_delimiter = '$'

path = "./知识库：问题和答案.csv"
# 这里是原始的分隔符
reader = list(csv.reader(open(path, "rU", encoding='utf-8'), delimiter=source_delimiter))
with open(path, 'w', encoding='utf-8') as csvfile:
    # 这里是修改后的分隔符
    writer = csv.writer(csvfile, delimiter=target_delimiter)
    writer.writerows(row for row in reader)
